export function bindAll(functions: Array<string>, context: any): void {
  functions.forEach((func: string) => {
    if (!context[func]) {
      return
    }
    context[func] = context[func].bind(context)
  })
}

export function extend(
  destination: any,
  ...sources: Array<Object | null>
): Object {
  sources.forEach((source: any) => {
    // eslint-disable-next-line guard-for-in,no-restricted-syntax
    for (const k in source) {
      destination[k] = source[k]
    }
  })
  return destination
}
